package kafka;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.listener.MessageListener;

/**
 * Created by thinkjoy on 2017/7/13.
 */
public class KafkaConsumerServer implements MessageListener<String,String> {
    /**
          * 监听器自动执行该方法
           *     消费消息
           *     自动提交offset
          *     执行业务代码
           *
     2      */
    @Override
    public void onMessage(ConsumerRecord<String, String> stringStringConsumerRecord) {
        System.out.println("kafka消息:"+stringStringConsumerRecord.value());
    }
}
